﻿namespace MoskvaFM
{
    public class StationSourceFactory
    {
        private readonly SpbStationSource spbStationSource;

        private readonly MskStationSource mskStationSource;

        public StationSourceFactory()
        {
            var formatter = new DocumentFormatter();
            spbStationSource = new SpbStationSource(formatter);
            mskStationSource = new MskStationSource(formatter);
        }

        public IStationSource GetSource(string fileName)
        {
            if (fileName.ToLower().Contains("msk"))
            {
                return mskStationSource;
            }

            if (fileName.ToLower().Contains("spb"))
            {
                return spbStationSource;
            }

            return null;
        }
    }
}